<div class="content-box"><!-- Start Content Box -->
    <div class="content-box-header">
        
        <h3>Thêm mới người dùng</h3>
        
        <ul class="content-box-tabs">
       
            <li><a href="index.php?page=user">Table</a></li> <!-- href must be unique and match the id of target div -->
            <li><a href="#tab2" class="default-tab">Forms</a></li>
        </ul>
        
        <div class="clear"></div>
        
    </div> <!-- End .content-box-header -->
    
    <div class="content-box-content">
   		
        

        <div class="content-box-tabs" id="tab2">
    <?php
	$txt_username='';$txt_pass='';$txt_fullname='';
	$hide_show=1;$id='';
	if(isset($_GET['id']))
		$id =$_GET['id'];
	
	if(isset($_POST['txt_username']))	{$txt_username=$_POST['txt_username'];$hide_show=0;}
	if(isset($_POST['txt_pass']))	$txt_pass=$_POST['txt_pass'];
	if(isset($_POST['txt_fullname']))	$txt_fullname=$_POST['txt_fullname'];
	
	if($hide_show==1)
	{
	?>
              
            <form action="index.php?page=user&act=add" method="post" enctype="multipart/form-data">
                
                <fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
                    
                    <p>
                        <label>Tên người dùng</label>
                        <input class="text-input small-input" type="text" id="txt_fullname" name="txt_fullname" value="<?php echo $txt_fullname;?>"/> 
                    </p>
                    
                    <p>
                        <label>Tài khoản</label>
                        <input class="text-input small-input" type="text" id="txt_username" name="txt_username" value="<?php echo $txt_username;?>"/> 
                    </p>
                    <p>
                        <label>Mật khẩu</label>
                        <input class="text-input small-input" type="password" id="txt_pass" name="txt_pass" /> 
                    </p>
            
                    <p>
                        <input class="button" type="submit" value="Submit" />
                        <input type="reset" value="Nhập lại" name="btn_reset"/>
                    </p>
                    
                </fieldset>
                
                <div class="clear"></div><!-- End .clear -->
                
            </form>
     <?php
	}
	else
	{
		//Xu ly them du lieu
		//Tao cau lenh SQL
		$sql='	INSERT INTO tbl_nguoidung(fullname,username,pass) VALUES("'.$txt_fullname.'","'.$txt_username.'", "'.md5($txt_pass).'")';
		
		//Thuc thi cau lenh SQL
		$result=mysql_query($sql);
		echo 'Thêm người dùng thành công';
		//Chuyen trang ve danh muc san pham
		header('location: index.php?page=user');
		}
	
	?>
        </div> <!-- End #tab2 -->
        
              
		
    </div> <!-- End .content-box-content -->
    
</div> <!-- End .content-box -->